<?php require_once("../cecndb.php"); 

$fecha=$_POST['txt_fecha'];
$aca=$_POST['txt_aca'];
$curso=$_POST['txt_cur'];
$docu=$_POST['txt_docu'];
$cant=$_POST['txt_cant'];

$sql=$conectarBD->query("SELECT * FROM gs07catpar");
  while ($res=$sql->fetch_assoc()) {
   	$val=$res['GS07COBO'];
      }  
      $sum=$val+1;

$sql=$conectarBD->query("INSERT INTO gs04regbol(GS04COBO,GS04FEBO,GS01COAC,GS02COTP,GS03COPR,GS04CACP)
	VALUES('$sum','$fecha','$aca','$docu','$curso','$cant')");

      $sql=$conectarBD->query("UPDATE gs07catpar SET GS07COBO='$sum'");

      echo'<script language=javascript>
        alert("Boleta generada: #"+'.$sum.')
        self.location="./form.php"
      </script>';	


?>